/*
 * Bill.java
 *
 * Created on 25 de Junho de 2007, 00:29
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package br.unifor.epayment.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity class Bill
 * 
 * @author adm
 */
@Entity
public class Bill implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @Column(name = "DESCRIPTION", nullable = false)
    private String description;
    
    @Column(name = "BILLVALUE", nullable = false)
    private Long value;
    
    //private BillType type;

    @Column(name = "PAYMENTDATE", nullable = false)
    @Temporal(TemporalType.DATE)    
    private Date paymentDate;
    
    @Column(name = "NUMTIMES", nullable = false)
    private Integer numTimes;
    
    @Column(name = "TIMES", nullable = false)
    private Integer times;

    @Column(name = "STATUS", nullable = false)
    private String status;
    
    /** Creates a new instance of Bill */
    public Bill() {
    }

    /**
     * Gets the id of this Bill.
     * @return the id
     */
    public Long getId() {
        return this.id;
    }

    /**
     * Sets the id of this Bill to the specified value.
     * @param id the new id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Returns a hash code value for the object.  This implementation computes 
     * a hash code value based on the id fields in this object.
     * @return a hash code value for this object.
     */
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    /**
     * Determines whether another object is equal to this Bill.  The result is 
     * <code>true</code> if and only if the argument is not null and is a Bill object that 
     * has the same id field values as this object.
     * @param object the reference object with which to compare
     * @return <code>true</code> if this object is the same as the argument;
     * <code>false</code> otherwise.
     */
    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Bill)) {
            return false;
        }
        Bill other = (Bill)object;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
        return true;
    }

    /**
     * Returns a string representation of the object.  This implementation constructs 
     * that representation based on the id fields.
     * @return a string representation of the object.
     */
    @Override
    public String toString() {
        return "br.unifor.epayment.entity.Bill[id=" + id + "]";
    }

    /**
     * Gets the description of this Bill.
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the description of this Bill to the specified value.
     * @param description the new description
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Gets the value of this Bill.
     * @return the value
     */
    public Long getValue() {
        return value;
    }

    /**
     * Sets the value of this Bill to the specified value.
     * @param value the new value
     */
    public void setValue(Long value) {
        this.value = value;
    }

    /**
     * Gets the paymentDate of this Bill.
     * @return the paymentDate
     */
    public Date getPaymentDate() {
        return paymentDate;
    }

    /**
     * Sets the paymentDate of this Bill to the specified value.
     * @param paymentDate the new paymentDate
     */
    public void setPaymentDate(Date paymentDate) {
        this.paymentDate = paymentDate;
    }

    /**
     * Gets the numTimes of this Bill.
     * @return the numTimes
     */
    public Integer getNumTimes() {
        return numTimes;
    }

    /**
     * Sets the numtimes of this Bill to the specified value.
     * @param numtimes the new numtimes
     */
    public void setNumTimes(Integer numTimes) {
        this.numTimes = numTimes;
    }

    /**
     * Gets the times of this Bill.
     * @return the times
     */
    public Integer getTimes() {
        return times;
    }

    /**
     * Sets the times of this Bill to the specified value.
     * @param times the new times
     */
    public void setTimes(Integer times) {
        this.times = times;
    }

    /**
     * Gets the status of this Bill.
     * @return the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * Sets the status of this Bill to the specified value.
     * @param status the new status
     */
    public void setStatus(String status) {
        this.status = status;
    }
    
}
